From 4ae9d1d5009945dd7aee7f9346846bddeca41a6e Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 18 Jan 2005 19:15:32 +0000 Subject: [PATCH] Handle case when mkshort has NO valid name. --- gpsbabel/mkshort.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index 19ec3a51e..5f40e1803 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -386,6 +386,14 @@ mkshort(void *h, const char *istring) strcpy(&ostring[hdl->target_len] - strlen(np), np); } + /* + * If, after all that, we have an empty string, punt and + * let the must_uniq code handle it. + */ + if (ostring[0] == '\0') { + ostring = xstrdup("WPT"); + } + if (hdl->must_uniq) { return mkshort_add_to_list(hdl, ostring); } -- 2.30.2